Public Class FormWarning


    Dim myWarning As DataTable
    Private Sub initalizeData()
        Try
            loadData()
        Catch ex As Exception
            Throw ex
        End Try
    End Sub
    Public Sub loadData()
        'Get Data From Database
        Try
            myWarning = Warnings.GetWarning
            dgvWarning.DataSource = myWarning
        Catch ex As Exception

        End Try
    End Sub

    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        Dbinterface.OpenConnection()
        initalizeData()
    End Sub
    Private Sub FormWarning_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        UI.FormatDataGrid(dgvWarning)
        btnAdd.Enabled = App.IsAuthorized(Permissions.Manage_Warning_Add)
        btnUpdate.Enabled = App.IsAuthorized(Permissions.Manage_Warning_Edit)
        btnDelete.Enabled = App.IsAuthorized(Permissions.Manage_Warning_Delete)
    End Sub
End Class